{extend name="layout/layout"}
{block name="content"}
<main class="active active5">
    <div class="head_a1">
        <div class="layui-main">
            <div class="b1">
                <div class="t1">步驟一：活動資訊( 活動類別 )</div>
                <a href="/" class="back_btn"><img src="__ROOT__/public/activity/images/out.png">返回首页</a>
            </div>
        </div>
    </div>
    <div class="main_a">
        <div class="layui-main">
            <div class="active_w c ">
                <p class="text-align-center ft18 mb40 ft-bold">選擇活動類型</p>
                <from class="layui-form">
                    <div class="content">
                        <div class="">
                            <ul class="layui-row layui-col-space25 ul_height a5_ul1 active_ul activity-type">
                            {foreach $typeList as $type }
                                <li class="layui-col-md2 layui-col-xs3">
                                    <div class="item {if $type.id==$selected}active{/if}" style="cursor: pointer;line-height: 1.4;" data-id="{$type.id}">
                                        <p>{$type.name}</p>
                                        <img src="{$type.thumb}" style="width: 100px;" alt="">
                                    </div>
                                </li>
                            {/foreach}
                            </ul>
                        </div>
                    </div>
                </from>
                <div class="mt100 d-flex jc-s al-c">
                    <a href="/activity/create/theme.html" class="last-btn">
                        <img src="__ROOT__/public/activity/images/out1.png">返回上一步
                    </a>
                    <a href="javascript:;" onclick="goNext()">
                        <button class="layui-btn layui-bg-orange next-btn">下一步</button>
                    </a>
                </div>
            </div>
        </div>
    </div>
    <script>
        function goNext() {
            var selected = $('.activity-type .active').data('id');
            $.quickPost('{:url("/activity/create/type")}', {type: selected}). done(res => {
                location.href = '/activity/create/info.html';
            });
        }
    </script>
</main>
{/block}